<?php 

function debug($arg, $die = true)
{
	echo '<pre>'; echo gettype($arg) . ': ';  print_r($arg); echo '</pre>';
	if($die == true)
	{
		die();
	}
}


function redirect($url, $code = '301')
{
	header('Location:'.$url);
    die();
}

function __autoload($class)
{
	global $conf;
	if( isset($conf['INCLUDE_PATHS']) && is_array($conf['INCLUDE_PATHS']) )	
	{
		foreach($conf['INCLUDE_PATHS'] as $path)
		{
			$file = $path . $class . '/class.' . $class . '.php';
			if(file_exists($file))
			{
				include $file;
				return true;
			}
		}
		return false;
	}
}

function  _init()
{
	global $project;
	global $conf;
	//load project config
	include PATH . 'project/config.php';
	
	include  PATH . 'library/core/core.php';
}


?>